using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;

public class ImageEditorScript
{
	public static Image Modify(Image image) 
	{
		Bitmap newBitmap = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppArgb);			
		using (Graphics g = Graphics.FromImage(newBitmap))
		{
			//g.DrawImage(image, 0.0f, 0.0f); //draw original image

			ImageAttributes imageAttributes = new ImageAttributes();
			int width = image.Width;
			int height = image.Height;

			float[][] colorMatrixElements = { 
												new float[] {1,  0,  0,  0, 0},        // red scaling factor of 1
												new float[] {0,  1,  0,  0, 0},        // green scaling factor of 1
												new float[] {0,  0,  1,  0, 0},        // blue scaling factor of 1
												new float[] {0,  0,  0,  1, 0},        // alpha scaling factor of 1
												new float[] {.1f, .1f, .1f, 0, 1}};    // three translations of 0.2

			ColorMatrix colorMatrix = new ColorMatrix(colorMatrixElements);

			imageAttributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default,ColorAdjustType.Bitmap);

			g.DrawImage(
				image, 
				new Rectangle(0, 0, width, height),  // destination rectangle 
				0, 0,        // upper-left corner of source rectangle 
				width,       // width of source rectangle
				height,      // height of source rectangle
				GraphicsUnit.Pixel,
				imageAttributes);
		} 
		return newBitmap;
    }
}